/*
 * @Author: 2112778581 2112778581@qq.com
 * @Date: 2023-10-17 11:04:56
 * @LastEditors: 2112778581 2112778581@qq.com
 * @LastEditTime: 2023-10-17 11:05:05
 * @FilePath: \cra-front\src\utils\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { App } from 'vue'
export const withInstall = <T>(component: T, alias?: string) => {
  const comp = component as any
  comp.install = (app: App) => {
    app.component(comp.name || comp.displayName, component)
    if (alias) {
      app.config.globalProperties[alias] = component
    }
  }
  return component as T & Plugin
}
